package com.ss.ttvideoengine.c;

import com.ss.ttvideoengine.d.TTVideoError;

public final class c extends a implements b {
    public static int f = 1;
    public int g;
    private static int h = 2;
    private a i;

    public c(String arg2, HttpRequest arg3) {
        super(arg2, arg3);
        this.g = 0;
    }

    public final void a() {
    }

    public final void a(TTVideoError arg1) {
    }

    public final void a(String arg3, TTVideoError ttVideoError) {
        if (this.isThreadInterrupted) {
            this.e();
        } else if (ttVideoError == null) {
            this.a(arg3);
        } else if (this.g == h - 1) {
            this.onError(ttVideoError);
        } else {
            this.b(ttVideoError);
            ++this.g;
            this.b();
        }
    }

    public final void b() {
        if (!this.isThreadInterrupted && this.g < h) {
            this.i = this.g == 0 ? new f(this.c) : new d(this.c, this.mHttpRequest);
            this.i.a(((b) this));
            this.i.b();
        }
    }

    public final void interrupt() {
        if (!this.isThreadInterrupted) {
            this.isThreadInterrupted = true;
            if (this.i != null) {
                this.i.interrupt();
            }
        }
    }
}

